#include <iostream>
using namespace std;
int main()
{
    int bcd;
    cin>>bcd;
    int tens = bcd / 16;  
    int ones = bcd % 16;
    int decimal = tens * 10 + ones;
    cout<<decimal;
}